﻿@model Tasks.UI.Models.ArticleModel
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>文章编辑</title>
    <link href="@Config.GetCssResourcePath("main.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/global.js")" type="text/javascript"></script>
    <script src="/Scripts/ckeditor/ckeditor_basic.js" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $().ready(function () {
            $("form").validate({
                errorPlacement: function (error, element) {
                    error.appendTo(element.parent())
                },
                rules: {
                    Title: "required",
                    Content: "required"
                },
                messages: {
                    Title: "请输入标题",
                    Content: "请输入内容",
                },
                /* 获得焦点时不验证 */
                focusInvalid: false,
                onkeyup: false
            });

        })

        $(function () {

            var ckConfig = {
                filebrowserImageUploadUrl: '/SystemSetting/CKEditorUploadImage',
                skin: 'office2003',
                toolbar: 'Basic'
            };
            CKEDITOR.replace('Content', ckConfig);
        })
       
    </script>
</head>
<body>
    @using (Html.BeginForm())
    {
        <div id="container">
            <div class="navTitle">
                编辑文章
            </div>
            @Html.OutputMessage(Model.Message, Model.MessageType)
            <table style="width: 99%;">
                <tr>
                    <td style="width: 80px;">
                        <strong>标题：</strong>
                    </td>
                    <td>
                        @Html.TextBoxFor(t => t.Title, new { style = "width:100%;" })
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        <strong>内容：</strong>
                    </td>
                    <td>                       
                        @Html.TextAreaFor(t => t.Content, new { style = "width:100%;height:420px;" })
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <input id="Submit1" class="large_button" type="submit" value="保存" />
                    </td>
                </tr>
            </table>
        </div>
    }
</body>
</html>
